package com.seventeen.monster.redisson.autoconfigure;

import com.seventeen.monster.redisson.core.DistributeLockAop;
import org.redisson.api.RedissonClient;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

/**
 * @author seventeen
 */
@Configuration
@EnableAspectJAutoProxy
public class DistributeLockConfiguration {

    @Bean
    @ConditionalOnMissingBean(DistributeLockAop.class)
    public DistributeLockAop distributeLockAop(RedissonClient redissonClient) {
        return new DistributeLockAop(redissonClient);
    }
}
